function rgs() {
    var username = $('#rusername').val().replace(/(^\s*)|(\s*$)/g, '');
    var password = $('#rpassword').val().replace(/(^\s*)|(\s*$)/g, '');

    if (username == "") {
        $('#register-tip').html("用户名不能为空");
        $('#register-tip').show();
        return;
    }
    else if (password == "") {
        $('#register-tip').html("密码不能为空");
        $('#register-tip').show();
        return;
    }

    $.ajax({
        url: Global.server + "/register",
        data: {"username": $('#rusername').val(), "password": $('#rpassword').val(), "email": $('#email').val()},
        type: "POST",
        success: function (data) {

            $('#register-tip').html(data);
            $('#register-tip').show();

        }

    })
}

/**
 * 输入校验
 */
$('.rgsajax').change(function () {

    $.ajax({
        url: Global.server + "/check",
        data: {"username": $('#rusername').val(), "password": $('#rpassword').val(), "email": $('#email').val()},
        type: "GET",
        success: function (data) {
            if (data == "") {
                $('#register-tip').hide();
            }
            else {
                $('#register-tip').html(data);
                $('#register-tip').show();
            }
        }

    })


})